package com.deer.wms.inventory.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deer.wms.inventory.dao.FreezeMasterMapper;
import com.deer.wms.inventory.model.freeze.FreezeMaster;
import com.deer.wms.inventory.model.freeze.FreezeMasterCriteria;
import com.deer.wms.inventory.model.freeze.FreezeMasterDto;
import com.deer.wms.inventory.service.FreezeMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by guo on 2019/12/25.
 */
@Service
@Transactional
public class FreezeMasterServiceImpl extends ServiceImpl<FreezeMasterMapper, FreezeMaster> implements FreezeMasterService {

    @Autowired
    private FreezeMasterMapper freezeMasterMapper;

    @Override
    public List<FreezeMasterDto> findList(FreezeMasterCriteria criteria) {
        return freezeMasterMapper.findList(criteria);
    }

    @Override
    public void deleteByBillNo(String billNo) {
        freezeMasterMapper.deleteByBillNo(billNo);
    }

    @Override
    public FreezeMaster findBy(String field, String value) {
        QueryWrapper<FreezeMaster> qw = new QueryWrapper<>();
        return getOne(qw.eq(field, value));
    }
}
